import path from 'path';
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],


  base: './',

  resolve: {
    // 配置路径别名
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },

  server: {
    fs: {
      strict: false,
    },
    host: '0.0.0.0',
    port: 8080,
    proxy: {
      '^/api': {
        target: 'http://127.0.0.1:8080',
        changeOrigin: true,
        prependPath: false,
      }
    },
  },

  build: {
    sourcemap: false,
    outDir: 'dist',  // 打包输出文件夹目录名称
  },
})
